home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 21
/
AMIGAplus Sonderheft 21 (1999)(ICP)(DE)[!].iso
/
Magazin
/
Future-PD
/
HTML-Creator
/
Source
/
CREATE_HTM's
< prev
next >
Wrap
Text File
|
1999-08-23
|
7KB
|
289 lines
x%=1:y%=x%:lan%=-1:ver$="$VER: Part of HTML-Creator V1.23"
ON ERROR GOTO fehler
OPEN "I",#1," CREATE_HTM's.info"
WHILE NOT EOF(1)
INPUT#1,x$
daus%=INSTR(x%,x$,"(DEUTSCH)")
20 dein%=INSTR(x%,x$,"DEUTSCH")
IF dein%=daus%+1 THEN x%=daus%+2:GOTO 20
eaus%=INSTR(y%,x$,"(ENGLISH)")
40 eein%=INSTR(y%,x$,"ENGLISH")
IF eein%=eaus%+1 THEN y%=eaus%+2:GOTO 40
WEND
CLOSE
IF dein%>daus%+1 THEN lan%=0
IF eein%>eaus%+1 OR (dein%=0 AND eein%=0) THEN lan%=1
start:
datcount%=0:DIM bilder$(5):filecount2%=0:gesamt%=0:count%=0:filecount3%=0
status2%=0
IF lan%=0 THEN
INPUT"Geben Sie den Pfad ein: ",pfad$
ELSE
INPUT"Please enter the path: ",pfad$
END IF
IF pfad$>"" THEN
IF RIGHT$(pfad$,1)="/" THEN
ELSE
IF RIGHT$(pfad$,1)=":" THEN
ELSE
pfad$=pfad$+"/"
END IF
END IF
END IF
IF lan%=0 THEN
bildfrage0:
PRINT"Wünschen Sie ein Hintergrundbild? j/n":PRINT"(Hinweis: Das gleiche Bild für alle Seiten)"
ja$="J"
else
PRINT"Do you want a background picture? y/n":PRINT"(notice: The same picture for all pages.)"
ja$="Y"
END IF
bildfrage1:a$=UCASE$(INKEY$):SLEEP
IF a$="" THEN bildfrage1
IF a$=ja$ THEN bildja
IF a$="N" THEN beginhtml
GOTO bildfrage1
bildja:
IF lan%=0 THEN
PRINT"Bitte geben Sie den Bildnamen (im Pfad ";pfad$;") an: ";
ELSE
PRINT "Please enter the picture name (within path ";pfad$;"): ";
END IF
INPUT "",bgbild$
checkpic%=1
OPEN"I",#255,pfad$+bgbild$
INPUT#255,x$
CLOSE #255
beginhtml:
checkpic%=0
OPEN "O",#5,pfad$+"INDEX.HTM"
PRINT#5,"<HTML>"
PRINT#5,"<!-- produced ON Amiga"
PRINT#5,"using the HTML-Creator (c) Martin Henke, 1998 //-->"
PRINT#5,"<HEAD>"
PRINT#5,"<TITLE>"
PRINT#5,"INDEX"
PRINT#5,"</TITLE>
PRINT#5,"</HEAD>"
PRINT#5,"<BODY";
IF bgbild$>"" THEN PRINT#5," BACKGROUND=";CHR$(34);bgbild$;chr$(34);
PRINT#5,">"
PRINT#5,"<TABLE CELLSPACING=4 BORDER=0>"
OPEN "I",#4,"directories.txt"
WHILE NOT EOF(4)
1 INPUT #4,dir$,dat$,status%
IF status%<2 AND status2%=1 THEN
PRINT#5,"</TABLE>"
PRINT#5,"<BR><BR>"
PRINT#5,"<A HREF="+CHR$(34)+"INDEX.HTM"+CHR$(34)+">INDEX</A>"
PRINT#5,"</BODY>"
PRINT#5,"</HTML>"
CLOSE #5
OPEN"A",#5,pfad$+"INDEX.HTM"
status2%=0
END IF
2 IF status%=0 AND status2%=0 THEN
status2%=1:subind$=dat$
PRINT#5,"</TR>"
PRINT#5,"<TD><A HREF="CHR$(34)+dat$+".HTM"+CHR$(34)+">"+dat$+"</A></TD>"
PRINT#5,"</TR>"
CLOSE #5
OPEN"O",#5,pfad$+dat$+".HTM"
PRINT#5,"<HTML>"
PRINT#5,"<!-- produced ON the Amiga"
PRINT#5,"using the HTML-Creator (c) Martin Henke, 1998 //-->"
PRINT#5,"<HEAD>"
PRINT#5,"<TITLE>"
PRINT#5,dat$+"-INDEX"
PRINT#5,"</TITLE>
PRINT#5,"</HEAD>"
PRINT#5,"<BODY";
IF bgbild$>"" THEN PRINT#5," BACKGROUND=";CHR$(34);bgbild$;chr$(34);
PRINT#5,">"
PRINT#5,"<TABLE CELLSPACING=4 BORDER=0>"
END IF
IF status%=0 THEN 1
IF status%=2 THEN 3
IF count%>0 THEN PRINT#5,"</TR>"
3 PRINT#5,"<TD>"+dat$+"</TD>"
filecount%=1:filecount2%=0:count%=0
CLOSE 1
OPEN"I",#1,"T:"+dat$+".txt"
OPEN"I",#3,"T:"+dat$+"2.txt"
4 INPUT#1,x$
WHILE a$<>CHR$(32)
count%=count%+1
a$=MID$(x$,count%,1)
IF a$="" THEN 4
WEND
gesamt%=VAL(LEFT$(x$,count%-1))
CLS:PRINT "Bearbeite Verzeichnis '"+dir$+"' mit"+STR$(gesamt%)+" Dateien.":PRINT
WHILE NOT EOF(1)
newhtm:
IF datcount%<10 THEN
datcount$="0"+RIGHT$(STR$(datcount%),1)
ELSE
datcount$=RIGHT$(STR$(datcount%),2)
END IF
IF filecount%=1 AND offen%=0 THEN
datcount2%=VAL(datcount$)+1
datcount2$=STR$(datcount2%)
datcount2$=RIGHT$(datcount2$,LEN(datcount2$)-1)
IF datcount2%<10 THEN datcount2$="0"+datcount2$
PRINT#5,"<TD>"+"<A HREF="+CHR$(34)+dat$+datcount$+".HTM"+CHR$(34)+">"+datcount2$+"</A></TD>"
PRINT "Erzeuge Datei "+pfad$+dat$+datcount$+".HTM"
OPEN "O",#2,pfad$+dat$+datcount$+".HTM"
offen%=1
PRINT#2,"<HTML>"
PRINT#2,"<!-- produced ON the Amiga"
PRINT#2,"using the HTML-Creator (c) Martin Henke, 1998 //-->"
PRINT#2,"<HEAD>"
PRINT#2,"<TITLE>"
PRINT#2,dat$
PRINT#2,"</TITLE>"
PRINT#2,"</HEAD>"
PRINT#2,"<BODY";
IF bgbild$>"" THEN PRINT#2," BACKGROUND=";CHR$(34);bgbild$;chr$(34);
PRINT#2,">"
PRINT#2,"<TABLE CELLSPACING=10 BORDER=0>
END IF
INPUT#1,x$
IF MID$(x$,LEN(x$)-2,1)=":" THEN
a$="":a=1
WHILE a$<>"."
a$=MID$(x$,a,1)
a=a+1
IF a=12 THEN weiter
WEND
GOTO weiter2
weiter:
a=9
weiter2:
a=a-1
datei$=LEFT$(x$,a+3):icon$=LEFT$(x$,a)+"GIF"
IF filecount2%=0 THEN PRINT#2,"<TR>"
bilder$(filecount2%)=datei$:filecount2%=filecount2%+1
filecount3%=filecount3%+1
PRINT#2,"<TD BGCOLOR=000000>
INPUT#3,x3$
x3$=RIGHT$(x3$,5)
breite$=LEFT$(x3$,2):hoehe$=RIGHT$(x3$,2)
PRINT#2,"<CENTER> <A HREF="+CHR$(34)+dir$+"/"+datei$+CHR$(34)+"><IMG SRC="+CHR$(34)+"ICONS/"+dir$+"/"+icon$+CHR$(34)+" WIDTH="+breite$+" HEIGHT="+hoehe$+" BORDER=0></A>"
PRINT#2,"</TD>"
IF filecount%=5 OR filecount%=10 OR filecount%=15 OR filecount3%=gesamt% THEN
PRINT datei$
PRINT#2,"</TR><TR>"
filecount2%=0
FOR y%=0 TO 4
IF bilder$(y%)>"" THEN
PRINT#2,"<TD> <CENTER>"
PRINT#2,bilder$(y%):bilder$(y%)=""
PRINT#2,"</TD>"
END IF
NEXT
IF filecount3%<gesamt% THEN PRINT#2,"</TR>"
END IF
filecount%=filecount%+1
END IF
IF filecount%=16 OR EOF(1) THEN
filecount%=1
datcount2%=datcount%-1
datcount3%=datcount%+1
IF datcount2%<10 THEN
datcount2$="0"+RIGHT$(STR$(datcount2%),1)
ELSE
datcount2$=RIGHT$(STR$(datcount2%),2)
END IF
IF datcount2%>0 THEN
previous$="<A HREF="+CHR$(34)+dat$+datcount2$+".HTM"
ELSE
IF status%=2 THEN
previous$="<A HREF="+CHR$(34)+subind$+".HTM"
ELSE
previous$="<A HREF="+CHR$(34)+"INDEX.HTM"
END IF
END IF
previous$=previous$+CHR$(34)+">PREVIOUS</A>"
IF datcount3%<10 THEN
datcount3$="0"+RIGHT$(STR$(datcount3%),1)
ELSE
datcount3$=RIGHT$(STR$(datcount3%),2)
END IF
IF filecount3%<gesamt% THEN
nextpage$="<A HREF="+CHR$(34)+dat$+datcount3$+".HTM"+CHR$(34)+">NEXT</A>"
ELSE
nextpage$="<A HREF="+CHR$(34)+"INDEX.HTM"+CHR$(34)+">NEXT</A>
END IF
datcount%=datcount%+1
PRINT#2,"</TABLE>"
PRINT#2,"<BR><BR>"
PRINT#2,"<A HREF="+CHR$(34)+"INDEX.HTM"+CHR$(34)+">INDEX</A>"
PRINT#2," "
PRINT#2,previous$
PRINT#2," "
PRINT#2,nextpage$
PRINT#2,"</BODY>"
PRINT#2,"</HTML>
CLOSE 2:offen%=0
FOR y%=0 TO 4:bilder$(y%)="":NEXT
IF EOF(1) THEN
datcount%=0
GOTO enddir
ELSE
GOTO newhtm
END IF
END IF
enddir:
WEND:CLOSE 3:filecount3%=0
PRINT#5,"</TR>"
WEND
enddir2:PRINT#5,"</TABLE>"
PRINT#5,"</BODY>"
PRINT#5,"</HTML>"
CLOSE
IF status%<>1 THEN
OPEN "A",#5,pfad$+"INDEX.HTM"
status%=1:GOTO enddir2
END IF
SYSTEM
fehler:
fehler%=ERR
IF lan%=-1 AND fehler%=53 THEN lan%=1:RESUME start
RESUME fehler2
fehler2:
IF checkpic%=1 THEN
PRINT
IF lan%=0 THEN
PRINT "Das Hintergrundbild konnte nicht gefunden werden."
ELSE
PRINT "The background picture could not be found."
END IF
PRINT
checkpic%=0
GOTO bildfrage0
END IF
IF lan%=0 THEN
IF fehler%<>53 THEN
PRINT "Es ist ein Fehler Nr. ";fehler%;" aufgetreten. Beende Programm.":PRINT "Bitte drücken Sie eine Taste."
ELSE
PRINT "Datei nicht gefunden."
END IF
ELSE
IF fehler%<>53 THEN
PRINT "An error number ";fehler%;" occurred. Aborting.":PRINT "Please press any key."
ELSE
PRINT "File not found."
END IF
END IF
ende:
a$=INKEY$:IF a$="" THEN SLEEP
IF a$>"" THEN SYSTEM
GOTO ende